package thread;

import java.util.Vector;

class MultipleK extends Thread {

	FactorialN result;
	int x, y;

	public MultipleK(FactorialN result, int x, int y) {
		this.result = result;
		this.x = x;
		this.y = y;
	}

	@Override
	public void run() {
		long subResult = 1l;
		for (int i = x; i <= y; i++)
			subResult *= i;

		synchronized (result) {
			result.result *= subResult;
						
		}
	}

}

public class FactorialN {
	long result;

	public FactorialN() {
		result = 1;
	}

}
